var span = document.getElementsByTagName("span")[0];
var em = document.getElementsByTagName("em")[0];
span.onclick = function () {
    history.back()
};
setInterval(function () {
    var s = em.innerHTML;
    if (s > 0)
        s = s - 1;
    em.innerHTML = s;
    if (s == 0) {
        history.back()
    }
}, 1000);